package com.service.single.controller;

import com.service.single.service.ElasticsearchService;
import com.service.single.util.R;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Author: 一休
 * @DateTime: 2022/11/4 15:53
 */
@RestController
@RequestMapping("/file")
public class ElasticsearchController {

    @Autowired
    private ElasticsearchService elasticsearchService;

    /**
     * 创建索引
     *
     * @param index
     * @return
     */
    @PostMapping("/createdIndex")
    public R<String> createdIndex(@RequestParam String index) {
        return elasticsearchService.createdIndex(index);
    }

}
